# -*- coding: utf-8 -*-
# @File     : inputPage.py.py
# @Project  : letCodeCase
# @Author   : 熊剑文
# @Time     : 2024/9/5 10:52:50
# @Copyright: 江西博微新技术有限公司
from common.basePage import BasePage

"""
模块描述：
    
"""
class InputPage(BasePage):

    def enter_fullname(self, fullname):
        self.input_text(self.fullName_box, fullname)

    def append_text(self, text, hotkey):
        self.input_text(self.append_box, text, append=True)
        append_box_element = self.get_element(self.append_box)
        self.hotkey(append_box_element, hotkey)

    def get_box_text(self):
        return self.get_element_attribute(self.inside_text_box, 'value')

    def clear_box_text(self):
        self.clear_element_text(self.clear_text_box)

    def confirm_disabled(self):
        element = self.get_element(self.enable_box)
        if element.is_enabled():
            return True
        else:
            return False

    def confirm_readonly(self):
        isReadOnly = self.get_element_attribute(self.readonly_box, 'readonly')
        if isReadOnly:
            return True
        else:
            return False